package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("goods/commodity")
public @caption("商品信息") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("commodity") class Commodity implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("id")    @primary  @notnull  @note("  ") Long id;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("商品名称") @column("name")     @notnull  @note("  ") String name;// 非空     
			
 			
 			
 		
	
		
	private @caption("标题") @column("title")     @notnull  @note("  ") String title;// 非空     
			
 			
 			
 		
	
		
	private @caption("排序") @column("c_sort")      @note("  数值越大越排前") Integer cSort;//  数值越大越排前   
			
 			
 			
 		
	
		
	private @caption("所属品牌") @column("merchant")     @notnull  @relate("$merchant") @RelateClass(Merchant.class)  @note("  ") Long merchant;// 非空     
			
 	private transient Merchant $merchant;//关联对象[品牌信息]
 			
 			
 			
 		
	
		
	private @caption("规格属性") @column("options")   @hidden   @notnull  @note(" text:name  ") String options;// 非空 text:name     
			
 			
 			
 		
	
		
	private @caption("商品单位") @column("unit")   @hidden    @relate("$unit") @RelateClass(Unit.class)  @note("  ") Long unit;//     
			
 	private transient Unit $unit;//关联对象[商品单位]
 			
 			
 			
 		
	
		
	private @caption("配送费") @column("distri_fee")   @hidden   @notnull  @note("  ") Double distriFee;// 非空     
			
 			
 			
 		
	
		
	private @caption("叠加配送费") @column("over_fee")   @hidden   @notnull  @note("  ") Double overFee;// 非空     
			
 			
 			
 		
	
		
	private @caption("商品描述") @column("descr") @like  @hidden   @notnull  @note("  ") String descr;// 非空     
			
 			
 			
 		
	
		
	private @caption("轮播图") @column("shufs")   @hidden   @notnull  @note("  ") String shufs;// 非空     
			
 			
 			
 		
	
		
	private @caption("列表图") @column("image")   @hidden   @notnull  @note("  ") String image;// 非空     
			
 			
 			
 		
	
		
	private @caption("假销量") @column("sale_vol")     @notnull  @note("  ") Integer saleVol;// 非空     
			
 			
 			
 		
	
		
	private @caption("真实销量") @column("rale_vol")      @note("  ") Integer raleVol;//     
			
 			
 			
 		
	
		
	private @caption("价格") @column("price")   @hidden   @notnull  @note("  ") Double price;// 非空     
			
 			
 			
 		
	
		
	private @caption("划线价格") @column("c_price")   @hidden    @note("  显示在商品详情页的划线价格；") Double cPrice;//  显示在商品详情页的划线价格；   
			
 			
 			
 		
	
		
	private @caption("分区价格") @column("zone_price") @like  @hidden    @note(" tree:area menoy:price  ") String zonePrice;// tree:area menoy:price     
			
 			
 			
 		
	
		
	private @caption("充多少") @column("how_much")   @hidden   @notnull  @note("  ") Integer howMuch;// 非空     
			
 			
 			
 		
	
		
	private @caption("赠多少") @column("how_many")   @hidden   @notnull  @note("  ") Integer howMany;// 非空     
			
 			
 			
 		
	
		
	private @caption("二维码") @column("c_qr_code")      @note("  ") String cQrCode;//     
			
 			
 			
 		
	
		
	private @caption("修改时间") @column("update_time")     @notnull  @note("  ") Date updateTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("add_time")     @notnull  @note("  ") Date addTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("状态") @column("status")     @notnull  @note(" 1:正常 0:无效  ") Short status;// 非空 1:正常 0:无效     
			
 			
 			
 		
	
	 
	//默认构造函数
	public Commodity(){ 
	
	}
	
	//主键构造函数
	public Commodity(Long id){
		this.id = id;
	}
	
	/**所有字段构造函数 
	 Commodity(
	 	Utils.getString("")//商品名称 [非空]
	 	,Utils.getString("")//标题 [非空]
	 	,Utils.getInteger("sort")//排序
	 	,Utils.getLong("")//所属品牌 [非空]
	 	,Utils.getString("")//规格属性 [非空]
	 	,Utils.getLong("")//商品单位
	 	,Utils.getDouble("fee")//配送费 [非空]
	 	,Utils.getDouble("fee")//叠加配送费 [非空]
	 	,Utils.getString("")//商品描述 [非空]
	 	,Utils.getString("")//轮播图 [非空]
	 	,Utils.getString("")//列表图 [非空]
	 	,Utils.getInteger("vol")//假销量 [非空]
	 	,Utils.getInteger("vol")//真实销量
	 	,Utils.getDouble("")//价格 [非空]
	 	,Utils.getDouble("price")//划线价格
	 	,Utils.getString("price")//分区价格
	 	,Utils.getInteger("much")//充多少 [非空]
	 	,Utils.getInteger("many")//赠多少 [非空]
	 	,Utils.getString("qrCode")//二维码
	 	,Utils.getDate("time")//修改时间 [非空]
	 	,Utils.getDate("time")//添加时间 [非空]
	 	,Utils.getShort("")//状态 [非空]
	 )
	**/
	public Commodity(String name,String title,Integer cSort,Long merchant,String options,Long unit,Double distriFee,Double overFee,String descr,String shufs,String image,Integer saleVol,Integer raleVol,Double price,Double cPrice,String zonePrice,Integer howMuch,Integer howMany,String cQrCode,Date updateTime,Date addTime,Short status){
		
			
			
		this.name=name;
		
			
		this.title=title;
		
			
		this.cSort=cSort;
		
			
		this.merchant=merchant;
		
			
		this.options=options;
		
			
		this.unit=unit;
		
			
		this.distriFee=distriFee;
		
			
		this.overFee=overFee;
		
			
		this.descr=descr;
		
			
		this.shufs=shufs;
		
			
		this.image=image;
		
			
		this.saleVol=saleVol;
		
			
		this.raleVol=raleVol;
		
			
		this.price=price;
		
			
		this.cPrice=cPrice;
		
			
		this.zonePrice=zonePrice;
		
			
		this.howMuch=howMuch;
		
			
		this.howMany=howMany;
		
			
		this.cQrCode=cQrCode;
		
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
	}
	
	//设置非空字段
	public Commodity setNotNull(String name,String title,Long merchant,String options,Double distriFee,Double overFee,String descr,String shufs,String image,Integer saleVol,Double price,Integer howMuch,Integer howMany,Date updateTime,Date addTime,Short status){
		
			
			
		this.name=name;
		
			
		this.title=title;
		
			
			
		this.merchant=merchant;
		
			
		this.options=options;
		
			
			
		this.distriFee=distriFee;
		
			
		this.overFee=overFee;
		
			
		this.descr=descr;
		
			
		this.shufs=shufs;
		
			
		this.image=image;
		
			
		this.saleVol=saleVol;
		
			
			
		this.price=price;
		
			
			
			
		this.howMuch=howMuch;
		
			
		this.howMany=howMany;
		
			
			
		this.updateTime=updateTime;
		
			
		this.addTime=addTime;
		
			
		this.status=status;
		
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public Commodity id(Long id){
		this.id = id;
		this.setSeted(F.id);
		return this;
	}
	
		
	/** 商品名称 [非空]       **/
	public Commodity name(String name){
		this.name = name;
		this.setSeted(F.name);
		return this;
	}
	
		
	/** 标题 [非空]       **/
	public Commodity title(String title){
		this.title = title;
		this.setSeted(F.title);
		return this;
	}
	
		
	/** 排序     数值越大越排前   **/
	public Commodity cSort(Integer cSort){
		this.cSort = cSort;
		this.setSeted(F.cSort);
		return this;
	}
	
		
	/** 所属品牌 [非空] [Merchant]      **/
	public Commodity merchant(Long merchant){
		this.merchant = merchant;
		this.setSeted(F.merchant);
		return this;
	}
	
		
	/** 规格属性 [非空]   text:name     **/
	public Commodity options(String options){
		this.options = options;
		this.setSeted(F.options);
		return this;
	}
	
		
	/** 商品单位  [Unit]      **/
	public Commodity unit(Long unit){
		this.unit = unit;
		this.setSeted(F.unit);
		return this;
	}
	
		
	/** 配送费 [非空]       **/
	public Commodity distriFee(Double distriFee){
		this.distriFee = distriFee;
		this.setSeted(F.distriFee);
		return this;
	}
	
		
	/** 叠加配送费 [非空]       **/
	public Commodity overFee(Double overFee){
		this.overFee = overFee;
		this.setSeted(F.overFee);
		return this;
	}
	
		
	/** 商品描述 [非空]       **/
	public Commodity descr(String descr){
		this.descr = descr;
		this.setSeted(F.descr);
		return this;
	}
	
		
	/** 轮播图 [非空]       **/
	public Commodity shufs(String shufs){
		this.shufs = shufs;
		this.setSeted(F.shufs);
		return this;
	}
	
		
	/** 列表图 [非空]       **/
	public Commodity image(String image){
		this.image = image;
		this.setSeted(F.image);
		return this;
	}
	
		
	/** 假销量 [非空]       **/
	public Commodity saleVol(Integer saleVol){
		this.saleVol = saleVol;
		this.setSeted(F.saleVol);
		return this;
	}
	
		
	/** 真实销量        **/
	public Commodity raleVol(Integer raleVol){
		this.raleVol = raleVol;
		this.setSeted(F.raleVol);
		return this;
	}
	
		
	/** 价格 [非空]       **/
	public Commodity price(Double price){
		this.price = price;
		this.setSeted(F.price);
		return this;
	}
	
		
	/** 划线价格     显示在商品详情页的划线价格；   **/
	public Commodity cPrice(Double cPrice){
		this.cPrice = cPrice;
		this.setSeted(F.cPrice);
		return this;
	}
	
		
	/** 分区价格    tree:area menoy:price     **/
	public Commodity zonePrice(String zonePrice){
		this.zonePrice = zonePrice;
		this.setSeted(F.zonePrice);
		return this;
	}
	
		
	/** 充多少 [非空]       **/
	public Commodity howMuch(Integer howMuch){
		this.howMuch = howMuch;
		this.setSeted(F.howMuch);
		return this;
	}
	
		
	/** 赠多少 [非空]       **/
	public Commodity howMany(Integer howMany){
		this.howMany = howMany;
		this.setSeted(F.howMany);
		return this;
	}
	
		
	/** 二维码        **/
	public Commodity cQrCode(String cQrCode){
		this.cQrCode = cQrCode;
		this.setSeted(F.cQrCode);
		return this;
	}
	
		
	/** 修改时间 [非空]       **/
	public Commodity updateTime(Date updateTime){
		this.updateTime = updateTime;
		this.setSeted(F.updateTime);
		return this;
	}
	
		
	/** 添加时间 [非空]       **/
	public Commodity addTime(Date addTime){
		this.addTime = addTime;
		this.setSeted(F.addTime);
		return this;
	}
	
		
	/** 状态 [非空]   1:正常 0:无效     **/
	public Commodity status(Short status){
		this.status = status;
		this.setSeted(F.status);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public Commodity clone(){
		Commodity clone = new Commodity();
		
			
			
		clone.name=this.name;
		
			
		clone.title=this.title;
		
			
		clone.cSort=this.cSort;
		
			
		clone.merchant=this.merchant;
		
			
		clone.options=this.options;
		
			
		clone.unit=this.unit;
		
			
		clone.distriFee=this.distriFee;
		
			
		clone.overFee=this.overFee;
		
			
		clone.descr=this.descr;
		
			
		clone.shufs=this.shufs;
		
			
		clone.image=this.image;
		
			
		clone.saleVol=this.saleVol;
		
			
		clone.raleVol=this.raleVol;
		
			
		clone.price=this.price;
		
			
		clone.cPrice=this.cPrice;
		
			
		clone.zonePrice=this.zonePrice;
		
			
		clone.howMuch=this.howMuch;
		
			
		clone.howMany=this.howMany;
		
			
		clone.cQrCode=this.cQrCode;
		
			
		clone.updateTime=this.updateTime;
		
			
		clone.addTime=this.addTime;
		
			
		clone.status=this.status;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取商品信息
	 * @param id
	 * @return
	 */
	public static @api Commodity get(Long id){		
		return getCommodityById(id);
	}
	
	
	
	/**
	 * 获取所有商品信息
	 * @return
	 */
	public static @api List<Commodity> list(Map params,Integer size){
		return getCommodityList(params,size);
	}
	/**
	 * 获取商品信息分页
	 * @return
	 */
	public static @api Page<Commodity> page(Integer page,Integer size,Map params){
		return getCommodityPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取商品信息
	 * @param params
	 * @return
	 */
	public static @api Commodity Get(Map params){
		return getCommodity(params);
	}
	/**
	 * 获取商品信息数
	 * @return
	 */
	public static @api Long count(Map params){
		return getCommodityCount(params);
	}
	/**
	 * 获取商品信息数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getCommodityEval(eval,params);
	}
	
	
	/**
	 * 获取商品信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getCommodityStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取商品信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getCommodityStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取商品信息
	 * @param id
	 * @return
	 */
	public static @api Commodity getCommodityById(Long id){		
		return getCommodityDao().getCommodityById(id);
	}
	
	
	
	
	/**
	 * 根据ID取商品信息的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(Commodity.class, id);
				
		if(value==null){
			Commodity commodity = get(id);
			if(commodity!=null){
				String strValue = commodity.getName$();
				
				if(!"Name".equals("Name"))
					strValue+="("+commodity.getName$()+")";
				
				
				Cache.setValue(Commodity.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(Commodity.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getName$();
		
		if(!"Name".equals("Name"))
			keyValue+="("+this.getName$()+")";
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询商品信息对象
	 * @return
	 */
	public static @api Commodity find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("id", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex+=" or name = '"+key.replaceAll("'", "''")+"'";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return Commodity.getCommodity(params);
	}
	
	
	/**
	 * 根据关键字查询商品信息
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("id", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex+=" or name like '%"+strTerm.replaceAll("'", "''")+"%'";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<Commodity> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(Commodity commodity:list){
			Map map = new HashMap();
			map.put("key",commodity.getId().toString());
			map.put("value", Utils.js(commodity.getKeyValue()));
			if(bObject==true)
				map.put("object",commodity);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有商品信息
	 * @return
	 */
	public static @api List<Commodity> getCommodityList(Map params,Integer size){
		return getCommodityDao().getCommodityList(params,0,size);
	}
	
	/**
	 * 获取商品信息分页
	 * @return
	 */
	public static @api Page<Commodity> getCommodityPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getCommodityDao().getCommodityPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取商品信息
	 * @param params
	 * @return
	 */
	public static @api Commodity getCommodity(Map params){
		return getCommodityDao().getCommodity(params);
	}
	
	/**
	 * 保存一个商品信息
	 * @param commodity
	 * @return
	 */
	public static @api Commodity saveCommodity(Commodity commodity){
		return getCommodityDao().saveCommodity(commodity);
	}
	
	/**
	 * 根据条件更新商品信息
	 * @param values
	 * @param params
	 */
	public static @api int updateCommodityByConfirm(Map values, Map params){
		return getCommodityDao().updateCommodityByConfirm(values,params);
	}
	
	/**
	 * 修改一个商品信息
	 * @param commodity
	 * @return
	 */
	public static @api int updateCommodity(Commodity commodity){
		return getCommodityDao().updateCommodity(commodity);
	}
	
	/**
	 * 更新商品信息非空字段
	 * @param commodity
	 */
	public static @api int updateCommodity$NotNull(Commodity commodity){
		return getCommodityDao().updateCommodity$NotNull(commodity);
	}
	
	/**
	 * 获取商品信息数
	 * @return
	 */
	public static @api Long getCommodityCount(Map params){
		return getCommodityDao().getCommodityCount(params);
	}
		
		
	/**
	 * 获取商品信息自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getCommodityEval(String eval,Map params){
		return getCommodityDao().getCommodityEval(eval,params);
	}
	
	
	/**
	 * 获取商品信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getCommodityStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getCommodityDao().getCommodityStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = Commodity.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(Commodity.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateCommodity(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getCommodityDao().updateCommodityByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteCommodity(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getCommodityDao().deleteCommodityByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getCommodityDao().removeCommodityById(id);
		
	}
	
	
	/**
	 * 保存商品信息对象
	 * @param params
	 * @return
	 */
	public Commodity save(){
		if(this.getId()!=null)
			getCommodityDao().updateCommodity(this);
		else
			return getCommodityDao().saveCommodity(this);
		return this;
	}
	
	
	/**
	 * 更新商品信息对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getCommodityDao().updateCommodity$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
		if(Utils.equals(Utils.config("logic_delete"),"true"))
			getCommodityDao().removeCommodityById(this.getId());
		else
		
			getCommodityDao().deleteCommodityById(this.getId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getCommodityDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getId(){
		
		if(this.id!=null){
			return this.id;
		}
		
		return this.id;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setId$(String strValue){
		if(Utils.empty(strValue)){
			this.id=null;
			return;
		}
	
	
	 	this.id=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setId(Long id){
		this.id = id;
		
		this.setSeted(F.id);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************商品名称**********************************/	
	/**
	* 商品名称 [非空]      
	**/
	public String getName(){
		
		if(this.name!=null){
			return this.name;
		}
		
		return this.name;
	}
	/**
	* 获取商品名称格式化(toString)
	**/
	public String getName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getName());
	 
	 	 return strValue;
	}
	/**
	* 根据商品名称反格式化
	**/
	public void setName$(String strValue){
		if(Utils.empty(strValue)){
			this.name=null;
			return;
		}
	
	
	 	this.name=strValue;
	 
	}
	
	/**
	* 商品名称 [非空]      
	**/
	public void setName(String name){
		this.name = name;
		
		this.setSeted(F.name);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************标题**********************************/	
	/**
	* 标题 [非空]      
	**/
	public String getTitle(){
		
		if(this.title!=null){
			return this.title;
		}
		
		return this.title;
	}
	/**
	* 获取标题格式化(toString)
	**/
	public String getTitle$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTitle());
	 
	 	 return strValue;
	}
	/**
	* 根据标题反格式化
	**/
	public void setTitle$(String strValue){
		if(Utils.empty(strValue)){
			this.title=null;
			return;
		}
	
	
	 	this.title=strValue;
	 
	}
	
	/**
	* 标题 [非空]      
	**/
	public void setTitle(String title){
		this.title = title;
		
		this.setSeted(F.title);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************排序**********************************/	
	/**
	* 排序     数值越大越排前  
	**/
	public Integer getcSort(){
		
		if(this.cSort!=null){
			return this.cSort;
		}
		
		return this.cSort;
	}
	/**
	* 获取排序格式化(toString)
	**/
	public String getcSort$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getcSort());
	 
	 	 return strValue;
	}
	/**
	* 根据排序反格式化
	**/
	public void setcSort$(String strValue){
		if(Utils.empty(strValue)){
			this.cSort=null;
			return;
		}
	
	
	 	this.cSort=Utils.parseInteger(strValue);
	 
	}
	
	/**
	* 排序     数值越大越排前  
	**/
	public void setcSort(Integer cSort){
		this.cSort = cSort;
		
		this.setSeted(F.cSort);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************所属品牌**********************************/	
	/**
	* 所属品牌 [非空] [Merchant]     
	**/
	public Long getMerchant(){
		
		if(this.merchant!=null){
			return this.merchant;
		}
		
		return this.merchant;
	}
	/**
	* 获取所属品牌格式化(toString)
	**/
	public String getMerchant$(){
		String strValue="";
	
	
		 
		if(this.getMerchant()!=null){
			
				strValue+=Utils.string(Merchant.getKeyValue(this.getMerchant()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据所属品牌反格式化
	**/
	public void setMerchant$(String strValue){
		if(Utils.empty(strValue)){
			this.merchant=null;
			return;
		}
	
	
		 
		Merchant item = Merchant.find(strValue);
		if(item!=null){
			
			this.merchant = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 所属品牌 [非空] [Merchant]     
	**/
	public void setMerchant(Long merchant){
		this.merchant = merchant;
		
		this.setSeted(F.merchant);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[品牌信息]
	**/	 			
 	public Merchant get$merchant(){
 		if(this.$merchant!=null)
 			return this.$merchant;
 		com.distribute.framework.model.Merchant merchant = null;
		if(this.getMerchant()!=null){
		
 			merchant = Merchant.get(this.getMerchant());
 		
 		}
 		return merchant;
	}
	
 	
	
	
	/*******************************规格属性**********************************/	
	/**
	* 规格属性 [非空]   text:name    
	**/
	public String getOptions(){
		
		if(this.options!=null){
			return this.options;
		}
		
		return this.options;
	}
	/**
	* 获取规格属性格式化(toString)
	**/
	public String getOptions$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getOptions());
	 
	 	 return strValue;
	}
	/**
	* 根据规格属性反格式化
	**/
	public void setOptions$(String strValue){
		if(Utils.empty(strValue)){
			this.options=null;
			return;
		}
	
	
		this.options=Utils.parseString(strValue);
	 
	}
	
	/**
	* 规格属性 [非空]   text:name    
	**/
	public void setOptions(String options){
		this.options = options;
		
		this.setSeted(F.options);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************商品单位**********************************/	
	/**
	* 商品单位  [Unit]     
	**/
	public Long getUnit(){
		
		if(this.unit!=null){
			return this.unit;
		}
		
		return this.unit;
	}
	/**
	* 获取商品单位格式化(toString)
	**/
	public String getUnit$(){
		String strValue="";
	
	
		 
		if(this.getUnit()!=null){
			
				strValue+=Utils.string(Unit.getKeyValue(this.getUnit()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据商品单位反格式化
	**/
	public void setUnit$(String strValue){
		if(Utils.empty(strValue)){
			this.unit=null;
			return;
		}
	
	
		 
		Unit item = Unit.find(strValue);
		if(item!=null){
			
			this.unit = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 商品单位  [Unit]     
	**/
	public void setUnit(Long unit){
		this.unit = unit;
		
		this.setSeted(F.unit);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[商品单位]
	**/	 			
 	public Unit get$unit(){
 		if(this.$unit!=null)
 			return this.$unit;
 		com.distribute.framework.model.Unit unit = null;
		if(this.getUnit()!=null){
		
 			unit = Unit.get(this.getUnit());
 		
 		}
 		return unit;
	}
	
 	
	
	
	/*******************************配送费**********************************/	
	/**
	* 配送费 [非空]      
	**/
	public Double getDistriFee(){
		
		if(this.distriFee!=null){
			return this.distriFee;
		}
		
		return this.distriFee;
	}
	/**
	* 获取配送费格式化(toString)
	**/
	public String getDistriFee$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getDistriFee());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据配送费反格式化
	**/
	public void setDistriFee$(String strValue){
		if(Utils.empty(strValue)){
			this.distriFee=null;
			return;
		}
	
	
	 	this.distriFee=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 配送费 [非空]      
	**/
	public void setDistriFee(Double distriFee){
		this.distriFee = distriFee;
		
		this.setSeted(F.distriFee);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************叠加配送费**********************************/	
	/**
	* 叠加配送费 [非空]      
	**/
	public Double getOverFee(){
		
		if(this.overFee!=null){
			return this.overFee;
		}
		
		return this.overFee;
	}
	/**
	* 获取叠加配送费格式化(toString)
	**/
	public String getOverFee$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getOverFee());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据叠加配送费反格式化
	**/
	public void setOverFee$(String strValue){
		if(Utils.empty(strValue)){
			this.overFee=null;
			return;
		}
	
	
	 	this.overFee=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 叠加配送费 [非空]      
	**/
	public void setOverFee(Double overFee){
		this.overFee = overFee;
		
		this.setSeted(F.overFee);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************商品描述**********************************/	
	/**
	* 商品描述 [非空]      
	**/
	public String getDescr(){
		
		if(this.descr!=null){
			return this.descr;
		}
		
		return this.descr;
	}
	/**
	* 获取商品描述格式化(toString)
	**/
	public String getDescr$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getDescr());
	 
	 	 return strValue;
	}
	/**
	* 根据商品描述反格式化
	**/
	public void setDescr$(String strValue){
		if(Utils.empty(strValue)){
			this.descr=null;
			return;
		}
	
	
		this.descr=strValue;
	 
	}
	
	/**
	* 商品描述 [非空]      
	**/
	public void setDescr(String descr){
		this.descr = descr;
		
		this.setSeted(F.descr);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************轮播图**********************************/	
	/**
	* 轮播图 [非空]      
	**/
	public String getShufs(){
		
		if(this.shufs!=null){
			return this.shufs;
		}
		
		return this.shufs;
	}
	/**
	* 获取轮播图格式化(toString)
	**/
	public String getShufs$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getShufs());
	 
	 	 return strValue;
	}
	/**
	* 根据轮播图反格式化
	**/
	public void setShufs$(String strValue){
		if(Utils.empty(strValue)){
			this.shufs=null;
			return;
		}
	
	
		this.shufs=Utils.parseString(strValue);
	 
	}
	
	/**
	* 轮播图 [非空]      
	**/
	public void setShufs(String shufs){
		this.shufs = shufs;
		
		this.setSeted(F.shufs);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************列表图**********************************/	
	/**
	* 列表图 [非空]      
	**/
	public String getImage(){
		
		if(this.image!=null){
			return this.image;
		}
		
		return this.image;
	}
	/**
	* 获取列表图格式化(toString)
	**/
	public String getImage$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getImage());
	 
	 	 return strValue;
	}
	/**
	* 根据列表图反格式化
	**/
	public void setImage$(String strValue){
		if(Utils.empty(strValue)){
			this.image=null;
			return;
		}
	
	
		this.image=Utils.parseString(strValue);
	 
	}
	
	/**
	* 列表图 [非空]      
	**/
	public void setImage(String image){
		this.image = image;
		
		this.setSeted(F.image);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************假销量**********************************/	
	/**
	* 假销量 [非空]      
	**/
	public Integer getSaleVol(){
		
		if(this.saleVol!=null){
			return this.saleVol;
		}
		
		return this.saleVol;
	}
	/**
	* 获取假销量格式化(toString)
	**/
	public String getSaleVol$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getSaleVol());
	 
	 	 return strValue;
	}
	/**
	* 根据假销量反格式化
	**/
	public void setSaleVol$(String strValue){
		if(Utils.empty(strValue)){
			this.saleVol=null;
			return;
		}
	
	
	 	this.saleVol=Utils.parseInteger(strValue);
	 
	}
	
	/**
	* 假销量 [非空]      
	**/
	public void setSaleVol(Integer saleVol){
		this.saleVol = saleVol;
		
		this.setSeted(F.saleVol);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************真实销量**********************************/	
	/**
	* 真实销量       
	**/
	public Integer getRaleVol(){
		
		if(this.raleVol!=null){
			return this.raleVol;
		}
		
		return this.raleVol;
	}
	/**
	* 获取真实销量格式化(toString)
	**/
	public String getRaleVol$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getRaleVol());
	 
	 	 return strValue;
	}
	/**
	* 根据真实销量反格式化
	**/
	public void setRaleVol$(String strValue){
		if(Utils.empty(strValue)){
			this.raleVol=null;
			return;
		}
	
	
	 	this.raleVol=Utils.parseInteger(strValue);
	 
	}
	
	/**
	* 真实销量       
	**/
	public void setRaleVol(Integer raleVol){
		this.raleVol = raleVol;
		
		this.setSeted(F.raleVol);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************价格**********************************/	
	/**
	* 价格 [非空]      
	**/
	public Double getPrice(){
		
		if(this.price!=null){
			return this.price;
		}
		
		return this.price;
	}
	/**
	* 获取价格格式化(toString)
	**/
	public String getPrice$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getPrice());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据价格反格式化
	**/
	public void setPrice$(String strValue){
		if(Utils.empty(strValue)){
			this.price=null;
			return;
		}
	
	
	 	this.price=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 价格 [非空]      
	**/
	public void setPrice(Double price){
		this.price = price;
		
		this.setSeted(F.price);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************划线价格**********************************/	
	/**
	* 划线价格     显示在商品详情页的划线价格；  
	**/
	public Double getcPrice(){
		
		if(this.cPrice!=null){
			return this.cPrice;
		}
		
		return this.cPrice;
	}
	/**
	* 获取划线价格格式化(toString)
	**/
	public String getcPrice$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getcPrice());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据划线价格反格式化
	**/
	public void setcPrice$(String strValue){
		if(Utils.empty(strValue)){
			this.cPrice=null;
			return;
		}
	
	
	 	this.cPrice=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 划线价格     显示在商品详情页的划线价格；  
	**/
	public void setcPrice(Double cPrice){
		this.cPrice = cPrice;
		
		this.setSeted(F.cPrice);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************分区价格**********************************/	
	/**
	* 分区价格    tree:area menoy:price    
	**/
	public String getZonePrice(){
		
		if(this.zonePrice!=null){
			return this.zonePrice;
		}
		
		return this.zonePrice;
	}
	/**
	* 获取分区价格格式化(toString)
	**/
	public String getZonePrice$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getZonePrice());
	 
	 	 return strValue;
	}
	/**
	* 根据分区价格反格式化
	**/
	public void setZonePrice$(String strValue){
		if(Utils.empty(strValue)){
			this.zonePrice=null;
			return;
		}
	
	
		this.zonePrice=Utils.parseString(strValue);
	 
	}
	
	/**
	* 分区价格    tree:area menoy:price    
	**/
	public void setZonePrice(String zonePrice){
		this.zonePrice = zonePrice;
		
		this.setSeted(F.zonePrice);
		
	}
	
	
	
	
	/**
	* 分区价格对应内部类
	**/
	public static class ZonePrice implements java.io.Serializable{
		
		String area;//所在地区  
		
		String price;//价格  
		
		
		/** 所在地区   **/
		public void setArea(String area){
			this.area=area;
		}
		/** 所在地区   **/
		public String getArea(){
			return this.area;
		}
		
		/** 价格   **/
		public void setPrice(String price){
			this.price=price;
		}
		/** 价格   **/
		public String getPrice(){
			return this.price;
		}
		
	}
	
	
	
	
	
	/**
	* 获取分区价格格式化列表
	**/ 			
 	public List<ZonePrice> get$zonePrice(){
 		List<ZonePrice> array = new ArrayList();
 		String strJson = this.zonePrice;
 		if(this.getSeted("zonePrice")==null || !this.getSeted("zonePrice")){
 			Commodity dbCommodity = Commodity.get(this.id);
 			if(dbCommodity!=null)
 				strJson = dbCommodity.getZonePrice();
 		} 
 		List<Map> list = (List<Map>) (Utils.empty(strJson) ? null : Utils.eval(strJson));
 		if(list!=null){
	 		for(Map map:list){
	 			ZonePrice zonePrice = new ZonePrice();
	 			
	 			zonePrice.setArea(Utils.parseString(map.get("area")));
	 			
	 			zonePrice.setPrice(Utils.parseString(map.get("price")));
	 			
	 			array.add(zonePrice);
	 		}
 		}else{
 			list = new ArrayList();
 		}
 		return array;
 	}
 	public void addZonePrice(String area,String price){
 		ZonePrice zonePrice = new ZonePrice();
 		
 		zonePrice.setArea(area);
		
 		zonePrice.setPrice(price);
		
		this.addZonePrice(zonePrice);
 	}
 	public void addZonePrice(ZonePrice zonePrice){
 		List<ZonePrice> array = get$zonePrice();
 		array.add(zonePrice);
 		this.zonePrice = Utils.json(array);
 	}
 	
 	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************充多少**********************************/	
	/**
	* 充多少 [非空]      
	**/
	public Integer getHowMuch(){
		
		if(this.howMuch!=null){
			return this.howMuch;
		}
		
		return this.howMuch;
	}
	/**
	* 获取充多少格式化(toString)
	**/
	public String getHowMuch$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getHowMuch());
	 
	 	 return strValue;
	}
	/**
	* 根据充多少反格式化
	**/
	public void setHowMuch$(String strValue){
		if(Utils.empty(strValue)){
			this.howMuch=null;
			return;
		}
	
	
	 	this.howMuch=Utils.parseInteger(strValue);
	 
	}
	
	/**
	* 充多少 [非空]      
	**/
	public void setHowMuch(Integer howMuch){
		this.howMuch = howMuch;
		
		this.setSeted(F.howMuch);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************赠多少**********************************/	
	/**
	* 赠多少 [非空]      
	**/
	public Integer getHowMany(){
		
		if(this.howMany!=null){
			return this.howMany;
		}
		
		return this.howMany;
	}
	/**
	* 获取赠多少格式化(toString)
	**/
	public String getHowMany$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getHowMany());
	 
	 	 return strValue;
	}
	/**
	* 根据赠多少反格式化
	**/
	public void setHowMany$(String strValue){
		if(Utils.empty(strValue)){
			this.howMany=null;
			return;
		}
	
	
	 	this.howMany=Utils.parseInteger(strValue);
	 
	}
	
	/**
	* 赠多少 [非空]      
	**/
	public void setHowMany(Integer howMany){
		this.howMany = howMany;
		
		this.setSeted(F.howMany);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************二维码**********************************/	
	/**
	* 二维码       
	**/
	public String getcQrCode(){
		
		if(this.cQrCode!=null){
			return this.cQrCode;
		}
		
		return this.cQrCode;
	}
	/**
	* 获取二维码格式化(toString)
	**/
	public String getcQrCode$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getcQrCode());
	 
	 	 return strValue;
	}
	/**
	* 根据二维码反格式化
	**/
	public void setcQrCode$(String strValue){
		if(Utils.empty(strValue)){
			this.cQrCode=null;
			return;
		}
	
	
		this.cQrCode=Utils.parseString(strValue);
	 
	}
	
	/**
	* 二维码       
	**/
	public void setcQrCode(String cQrCode){
		this.cQrCode = cQrCode;
		
		this.setSeted(F.cQrCode);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************修改时间**********************************/	
	/**
	* 修改时间 [非空]      
	**/
	public Date getUpdateTime(){
		
		if(this.updateTime!=null){
			return this.updateTime;
		}
		
		return this.updateTime;
	}
	/**
	* 获取修改时间格式化(toString)
	**/
	public String getUpdateTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getUpdateTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据修改时间反格式化
	**/
	public void setUpdateTime$(String strValue){
		if(Utils.empty(strValue)){
			this.updateTime=null;
			return;
		}
	
	
	 	this.updateTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 修改时间 [非空]      
	**/
	public void setUpdateTime(Date updateTime){
		this.updateTime = updateTime;
		
		this.setSeted(F.updateTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间 [非空]      
	**/
	public Date getAddTime(){
		
		if(this.addTime!=null){
			return this.addTime;
		}
		
		return this.addTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.addTime=null;
			return;
		}
	
	
	 	this.addTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间 [非空]      
	**/
	public void setAddTime(Date addTime){
		this.addTime = addTime;
		
		this.setSeted(F.addTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************状态**********************************/	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public Short getStatus(){
		
		if(this.status!=null){
			return this.status;
		}
		
		return this.status;
	}
	/**
	* 获取状态格式化(toString)
	**/
	public String getStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getStatus()),"1"))
			strValue=Utils.string("正常");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"0"))
			strValue=Utils.string("无效");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据状态反格式化
	**/
	public void setStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.status=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"正常"))
		 	this.status=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"无效"))
		 	this.status=Utils.parseShort("0");
			
		
	 
	}
	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public void setStatus(Short status){
		this.status = status;
		
		this.setSeted(F.status);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(Commodity.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(Commodity.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(Commodity.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(Commodity.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(Commodity.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${Commodity.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Commodity.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Commodity.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(Commodity.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${Commodity.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Commodity.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Commodity.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(Commodity.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M id(Object id){if(proxy)return proxy().id(id);  this.put("id", id);return this;};
	 	/** and id is null */
 		public M idNull(){if(proxy)return proxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
 		/** not .... */
 		public M idNot(){if(proxy)return proxy().idNot();this.put("idNot", "not");return this;};
 		public M idNotNull(){if(proxy)return proxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
 		public M idNot(Object id){if(proxy)return proxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	 		
		/** and id <= ? */
		public M idMin(Object min){if(proxy)return proxy().idMin(min);this.put("idMin", min);return this;};
		/** and id >= ? */
		public M idMax(Object max){if(proxy)return proxy().idMax(max);this.put("idMax", max);return this;};
			
			
		public M idIn(String ids){
			if(proxy)return proxy().idIn(ids);  this.put("idIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 商品名称 [非空]       **/
		public M name(Object name){if(proxy)return proxy().name(name);  this.put("name", name);return this;};
	 	/** and name is null */
 		public M nameNull(){if(proxy)return proxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
 		/** not .... */
 		public M nameNot(){if(proxy)return proxy().nameNot();this.put("nameNot", "not");return this;};
 		public M nameNotNull(){if(proxy)return proxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
 		public M nameNot(Object name){if(proxy)return proxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	 		
			
		
			
	 	
			
		
		/** 标题 [非空]       **/
		public M title(Object title){if(proxy)return proxy().title(title);  this.put("title", title);return this;};
	 	/** and title is null */
 		public M titleNull(){if(proxy)return proxy().titleNull();if(this.get("titleNot")==null)this.put("titleNot", "");this.put("title", null);return this;};
 		/** not .... */
 		public M titleNot(){if(proxy)return proxy().titleNot();this.put("titleNot", "not");return this;};
 		public M titleNotNull(){if(proxy)return proxy().titleNotNull();this.put("titleNot", "not");this.put("title", null);return this;};
 		public M titleNot(Object title){if(proxy)return proxy().titleNot(title);this.put("titleNot", "not");this.put("title", title);return this;};
	 		
			
		
			
	 	
			
		
		/** 排序     数值越大越排前   **/
		public M cSort(Object cSort){if(proxy)return proxy().cSort(cSort);  this.put("cSort", cSort);return this;};
	 	/** and c_sort is null */
 		public M cSortNull(){if(proxy)return proxy().cSortNull();if(this.get("cSortNot")==null)this.put("cSortNot", "");this.put("cSort", null);return this;};
 		/** not .... */
 		public M cSortNot(){if(proxy)return proxy().cSortNot();this.put("cSortNot", "not");return this;};
 		public M cSortNotNull(){if(proxy)return proxy().cSortNotNull();this.put("cSortNot", "not");this.put("cSort", null);return this;};
 		public M cSortNot(Object cSort){if(proxy)return proxy().cSortNot(cSort);this.put("cSortNot", "not");this.put("cSort", cSort);return this;};
	 		
		/** and c_sort <= ? */
		public M cSortMin(Object min){if(proxy)return proxy().cSortMin(min);this.put("cSortMin", min);return this;};
		/** and c_sort >= ? */
		public M cSortMax(Object max){if(proxy)return proxy().cSortMax(max);this.put("cSortMax", max);return this;};
			
			
		public M cSortIn(String ids){
			if(proxy)return proxy().cSortIn(ids);  this.put("cSortIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M merchant$on(Merchant.M value){if(proxy)return proxy().merchant$on(value);this.put("Merchant", value);value.put("on", "merchant");return this;};
 				
 			
		
		/** 所属品牌 [非空] [Merchant]      **/
		public M merchant(Object merchant){if(proxy)return proxy().merchant(merchant);  this.put("merchant", merchant);return this;};
	 	/** and merchant is null */
 		public M merchantNull(){if(proxy)return proxy().merchantNull();if(this.get("merchantNot")==null)this.put("merchantNot", "");this.put("merchant", null);return this;};
 		/** not .... */
 		public M merchantNot(){if(proxy)return proxy().merchantNot();this.put("merchantNot", "not");return this;};
 		public M merchantNotNull(){if(proxy)return proxy().merchantNotNull();this.put("merchantNot", "not");this.put("merchant", null);return this;};
 		public M merchantNot(Object merchant){if(proxy)return proxy().merchantNot(merchant);this.put("merchantNot", "not");this.put("merchant", merchant);return this;};
	 		
			
		public M merchantIn(String ids){
			if(proxy)return proxy().merchantIn(ids);  this.put("merchantIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 规格属性 [非空]   text:name     **/
		public M options(Object options){if(proxy)return proxy().options(options);  this.put("options", options);return this;};
	 	/** and options is null */
 		public M optionsNull(){if(proxy)return proxy().optionsNull();if(this.get("optionsNot")==null)this.put("optionsNot", "");this.put("options", null);return this;};
 		/** not .... */
 		public M optionsNot(){if(proxy)return proxy().optionsNot();this.put("optionsNot", "not");return this;};
 		public M optionsNotNull(){if(proxy)return proxy().optionsNotNull();this.put("optionsNot", "not");this.put("options", null);return this;};
 		public M optionsNot(Object options){if(proxy)return proxy().optionsNot(options);this.put("optionsNot", "not");this.put("options", options);return this;};
	 		
			
		
			
	 	
			
		public M unit$on(Unit.M value){if(proxy)return proxy().unit$on(value);this.put("Unit", value);value.put("on", "unit");return this;};
 				
 			
		
		/** 商品单位  [Unit]      **/
		public M unit(Object unit){if(proxy)return proxy().unit(unit);  this.put("unit", unit);return this;};
	 	/** and unit is null */
 		public M unitNull(){if(proxy)return proxy().unitNull();if(this.get("unitNot")==null)this.put("unitNot", "");this.put("unit", null);return this;};
 		/** not .... */
 		public M unitNot(){if(proxy)return proxy().unitNot();this.put("unitNot", "not");return this;};
 		public M unitNotNull(){if(proxy)return proxy().unitNotNull();this.put("unitNot", "not");this.put("unit", null);return this;};
 		public M unitNot(Object unit){if(proxy)return proxy().unitNot(unit);this.put("unitNot", "not");this.put("unit", unit);return this;};
	 		
			
		public M unitIn(String ids){
			if(proxy)return proxy().unitIn(ids);  this.put("unitIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 配送费 [非空]       **/
		public M distriFee(Object distriFee){if(proxy)return proxy().distriFee(distriFee);  this.put("distriFee", distriFee);return this;};
	 	/** and distri_fee is null */
 		public M distriFeeNull(){if(proxy)return proxy().distriFeeNull();if(this.get("distriFeeNot")==null)this.put("distriFeeNot", "");this.put("distriFee", null);return this;};
 		/** not .... */
 		public M distriFeeNot(){if(proxy)return proxy().distriFeeNot();this.put("distriFeeNot", "not");return this;};
 		public M distriFeeNotNull(){if(proxy)return proxy().distriFeeNotNull();this.put("distriFeeNot", "not");this.put("distriFee", null);return this;};
 		public M distriFeeNot(Object distriFee){if(proxy)return proxy().distriFeeNot(distriFee);this.put("distriFeeNot", "not");this.put("distriFee", distriFee);return this;};
	 		
		/** and distri_fee <= ? */
		public M distriFeeMin(Object min){if(proxy)return proxy().distriFeeMin(min);this.put("distriFeeMin", min);return this;};
		/** and distri_fee >= ? */
		public M distriFeeMax(Object max){if(proxy)return proxy().distriFeeMax(max);this.put("distriFeeMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 叠加配送费 [非空]       **/
		public M overFee(Object overFee){if(proxy)return proxy().overFee(overFee);  this.put("overFee", overFee);return this;};
	 	/** and over_fee is null */
 		public M overFeeNull(){if(proxy)return proxy().overFeeNull();if(this.get("overFeeNot")==null)this.put("overFeeNot", "");this.put("overFee", null);return this;};
 		/** not .... */
 		public M overFeeNot(){if(proxy)return proxy().overFeeNot();this.put("overFeeNot", "not");return this;};
 		public M overFeeNotNull(){if(proxy)return proxy().overFeeNotNull();this.put("overFeeNot", "not");this.put("overFee", null);return this;};
 		public M overFeeNot(Object overFee){if(proxy)return proxy().overFeeNot(overFee);this.put("overFeeNot", "not");this.put("overFee", overFee);return this;};
	 		
		/** and over_fee <= ? */
		public M overFeeMin(Object min){if(proxy)return proxy().overFeeMin(min);this.put("overFeeMin", min);return this;};
		/** and over_fee >= ? */
		public M overFeeMax(Object max){if(proxy)return proxy().overFeeMax(max);this.put("overFeeMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 商品描述 [非空]       **/
		public M descr(Object descr){if(proxy)return proxy().descr(descr);  this.put("descr", descr);return this;};
	 	/** and descr is null */
 		public M descrNull(){if(proxy)return proxy().descrNull();if(this.get("descrNot")==null)this.put("descrNot", "");this.put("descr", null);return this;};
 		/** not .... */
 		public M descrNot(){if(proxy)return proxy().descrNot();this.put("descrNot", "not");return this;};
 		public M descrNotNull(){if(proxy)return proxy().descrNotNull();this.put("descrNot", "not");this.put("descr", null);return this;};
 		public M descrNot(Object descr){if(proxy)return proxy().descrNot(descr);this.put("descrNot", "not");this.put("descr", descr);return this;};
	 		
			
		
			
	 	
			
		
		/** 轮播图 [非空]       **/
		public M shufs(Object shufs){if(proxy)return proxy().shufs(shufs);  this.put("shufs", shufs);return this;};
	 	/** and shufs is null */
 		public M shufsNull(){if(proxy)return proxy().shufsNull();if(this.get("shufsNot")==null)this.put("shufsNot", "");this.put("shufs", null);return this;};
 		/** not .... */
 		public M shufsNot(){if(proxy)return proxy().shufsNot();this.put("shufsNot", "not");return this;};
 		public M shufsNotNull(){if(proxy)return proxy().shufsNotNull();this.put("shufsNot", "not");this.put("shufs", null);return this;};
 		public M shufsNot(Object shufs){if(proxy)return proxy().shufsNot(shufs);this.put("shufsNot", "not");this.put("shufs", shufs);return this;};
	 		
			
		
			
	 	
			
		
		/** 列表图 [非空]       **/
		public M image(Object image){if(proxy)return proxy().image(image);  this.put("image", image);return this;};
	 	/** and image is null */
 		public M imageNull(){if(proxy)return proxy().imageNull();if(this.get("imageNot")==null)this.put("imageNot", "");this.put("image", null);return this;};
 		/** not .... */
 		public M imageNot(){if(proxy)return proxy().imageNot();this.put("imageNot", "not");return this;};
 		public M imageNotNull(){if(proxy)return proxy().imageNotNull();this.put("imageNot", "not");this.put("image", null);return this;};
 		public M imageNot(Object image){if(proxy)return proxy().imageNot(image);this.put("imageNot", "not");this.put("image", image);return this;};
	 		
			
		
			
	 	
			
		
		/** 假销量 [非空]       **/
		public M saleVol(Object saleVol){if(proxy)return proxy().saleVol(saleVol);  this.put("saleVol", saleVol);return this;};
	 	/** and sale_vol is null */
 		public M saleVolNull(){if(proxy)return proxy().saleVolNull();if(this.get("saleVolNot")==null)this.put("saleVolNot", "");this.put("saleVol", null);return this;};
 		/** not .... */
 		public M saleVolNot(){if(proxy)return proxy().saleVolNot();this.put("saleVolNot", "not");return this;};
 		public M saleVolNotNull(){if(proxy)return proxy().saleVolNotNull();this.put("saleVolNot", "not");this.put("saleVol", null);return this;};
 		public M saleVolNot(Object saleVol){if(proxy)return proxy().saleVolNot(saleVol);this.put("saleVolNot", "not");this.put("saleVol", saleVol);return this;};
	 		
		/** and sale_vol <= ? */
		public M saleVolMin(Object min){if(proxy)return proxy().saleVolMin(min);this.put("saleVolMin", min);return this;};
		/** and sale_vol >= ? */
		public M saleVolMax(Object max){if(proxy)return proxy().saleVolMax(max);this.put("saleVolMax", max);return this;};
			
			
		public M saleVolIn(String ids){
			if(proxy)return proxy().saleVolIn(ids);  this.put("saleVolIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 真实销量        **/
		public M raleVol(Object raleVol){if(proxy)return proxy().raleVol(raleVol);  this.put("raleVol", raleVol);return this;};
	 	/** and rale_vol is null */
 		public M raleVolNull(){if(proxy)return proxy().raleVolNull();if(this.get("raleVolNot")==null)this.put("raleVolNot", "");this.put("raleVol", null);return this;};
 		/** not .... */
 		public M raleVolNot(){if(proxy)return proxy().raleVolNot();this.put("raleVolNot", "not");return this;};
 		public M raleVolNotNull(){if(proxy)return proxy().raleVolNotNull();this.put("raleVolNot", "not");this.put("raleVol", null);return this;};
 		public M raleVolNot(Object raleVol){if(proxy)return proxy().raleVolNot(raleVol);this.put("raleVolNot", "not");this.put("raleVol", raleVol);return this;};
	 		
		/** and rale_vol <= ? */
		public M raleVolMin(Object min){if(proxy)return proxy().raleVolMin(min);this.put("raleVolMin", min);return this;};
		/** and rale_vol >= ? */
		public M raleVolMax(Object max){if(proxy)return proxy().raleVolMax(max);this.put("raleVolMax", max);return this;};
			
			
		public M raleVolIn(String ids){
			if(proxy)return proxy().raleVolIn(ids);  this.put("raleVolIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 价格 [非空]       **/
		public M price(Object price){if(proxy)return proxy().price(price);  this.put("price", price);return this;};
	 	/** and price is null */
 		public M priceNull(){if(proxy)return proxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
 		/** not .... */
 		public M priceNot(){if(proxy)return proxy().priceNot();this.put("priceNot", "not");return this;};
 		public M priceNotNull(){if(proxy)return proxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
 		public M priceNot(Object price){if(proxy)return proxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	 		
		/** and price <= ? */
		public M priceMin(Object min){if(proxy)return proxy().priceMin(min);this.put("priceMin", min);return this;};
		/** and price >= ? */
		public M priceMax(Object max){if(proxy)return proxy().priceMax(max);this.put("priceMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 划线价格     显示在商品详情页的划线价格；   **/
		public M cPrice(Object cPrice){if(proxy)return proxy().cPrice(cPrice);  this.put("cPrice", cPrice);return this;};
	 	/** and c_price is null */
 		public M cPriceNull(){if(proxy)return proxy().cPriceNull();if(this.get("cPriceNot")==null)this.put("cPriceNot", "");this.put("cPrice", null);return this;};
 		/** not .... */
 		public M cPriceNot(){if(proxy)return proxy().cPriceNot();this.put("cPriceNot", "not");return this;};
 		public M cPriceNotNull(){if(proxy)return proxy().cPriceNotNull();this.put("cPriceNot", "not");this.put("cPrice", null);return this;};
 		public M cPriceNot(Object cPrice){if(proxy)return proxy().cPriceNot(cPrice);this.put("cPriceNot", "not");this.put("cPrice", cPrice);return this;};
	 		
		/** and c_price <= ? */
		public M cPriceMin(Object min){if(proxy)return proxy().cPriceMin(min);this.put("cPriceMin", min);return this;};
		/** and c_price >= ? */
		public M cPriceMax(Object max){if(proxy)return proxy().cPriceMax(max);this.put("cPriceMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 分区价格    tree:area menoy:price     **/
		public M zonePrice(Object zonePrice){if(proxy)return proxy().zonePrice(zonePrice);  this.put("zonePrice", zonePrice);return this;};
	 	/** and zone_price is null */
 		public M zonePriceNull(){if(proxy)return proxy().zonePriceNull();if(this.get("zonePriceNot")==null)this.put("zonePriceNot", "");this.put("zonePrice", null);return this;};
 		/** not .... */
 		public M zonePriceNot(){if(proxy)return proxy().zonePriceNot();this.put("zonePriceNot", "not");return this;};
 		public M zonePriceNotNull(){if(proxy)return proxy().zonePriceNotNull();this.put("zonePriceNot", "not");this.put("zonePrice", null);return this;};
 		public M zonePriceNot(Object zonePrice){if(proxy)return proxy().zonePriceNot(zonePrice);this.put("zonePriceNot", "not");this.put("zonePrice", zonePrice);return this;};
	 		
			
		
			
	 	
			
		
		/** 充多少 [非空]       **/
		public M howMuch(Object howMuch){if(proxy)return proxy().howMuch(howMuch);  this.put("howMuch", howMuch);return this;};
	 	/** and how_much is null */
 		public M howMuchNull(){if(proxy)return proxy().howMuchNull();if(this.get("howMuchNot")==null)this.put("howMuchNot", "");this.put("howMuch", null);return this;};
 		/** not .... */
 		public M howMuchNot(){if(proxy)return proxy().howMuchNot();this.put("howMuchNot", "not");return this;};
 		public M howMuchNotNull(){if(proxy)return proxy().howMuchNotNull();this.put("howMuchNot", "not");this.put("howMuch", null);return this;};
 		public M howMuchNot(Object howMuch){if(proxy)return proxy().howMuchNot(howMuch);this.put("howMuchNot", "not");this.put("howMuch", howMuch);return this;};
	 		
		/** and how_much <= ? */
		public M howMuchMin(Object min){if(proxy)return proxy().howMuchMin(min);this.put("howMuchMin", min);return this;};
		/** and how_much >= ? */
		public M howMuchMax(Object max){if(proxy)return proxy().howMuchMax(max);this.put("howMuchMax", max);return this;};
			
			
		public M howMuchIn(String ids){
			if(proxy)return proxy().howMuchIn(ids);  this.put("howMuchIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 赠多少 [非空]       **/
		public M howMany(Object howMany){if(proxy)return proxy().howMany(howMany);  this.put("howMany", howMany);return this;};
	 	/** and how_many is null */
 		public M howManyNull(){if(proxy)return proxy().howManyNull();if(this.get("howManyNot")==null)this.put("howManyNot", "");this.put("howMany", null);return this;};
 		/** not .... */
 		public M howManyNot(){if(proxy)return proxy().howManyNot();this.put("howManyNot", "not");return this;};
 		public M howManyNotNull(){if(proxy)return proxy().howManyNotNull();this.put("howManyNot", "not");this.put("howMany", null);return this;};
 		public M howManyNot(Object howMany){if(proxy)return proxy().howManyNot(howMany);this.put("howManyNot", "not");this.put("howMany", howMany);return this;};
	 		
		/** and how_many <= ? */
		public M howManyMin(Object min){if(proxy)return proxy().howManyMin(min);this.put("howManyMin", min);return this;};
		/** and how_many >= ? */
		public M howManyMax(Object max){if(proxy)return proxy().howManyMax(max);this.put("howManyMax", max);return this;};
			
			
		public M howManyIn(String ids){
			if(proxy)return proxy().howManyIn(ids);  this.put("howManyIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 二维码        **/
		public M cQrCode(Object cQrCode){if(proxy)return proxy().cQrCode(cQrCode);  this.put("cQrCode", cQrCode);return this;};
	 	/** and c_qr_code is null */
 		public M cQrCodeNull(){if(proxy)return proxy().cQrCodeNull();if(this.get("cQrCodeNot")==null)this.put("cQrCodeNot", "");this.put("cQrCode", null);return this;};
 		/** not .... */
 		public M cQrCodeNot(){if(proxy)return proxy().cQrCodeNot();this.put("cQrCodeNot", "not");return this;};
 		public M cQrCodeNotNull(){if(proxy)return proxy().cQrCodeNotNull();this.put("cQrCodeNot", "not");this.put("cQrCode", null);return this;};
 		public M cQrCodeNot(Object cQrCode){if(proxy)return proxy().cQrCodeNot(cQrCode);this.put("cQrCodeNot", "not");this.put("cQrCode", cQrCode);return this;};
	 		
			
		
			
	 	
			
		
		/** 修改时间 [非空]       **/
		public M updateTime(Object updateTime){if(proxy)return proxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	 	/** and update_time is null */
 		public M updateTimeNull(){if(proxy)return proxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
 		/** not .... */
 		public M updateTimeNot(){if(proxy)return proxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
 		public M updateTimeNotNull(){if(proxy)return proxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
 		public M updateTimeNot(Object updateTime){if(proxy)return proxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	 		
 		/** and update_time >= ? */
 		public M updateTimeStart(Object start){if(proxy)return proxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
 		/** and update_time <= ? */
 		public M updateTimeEnd(Object end){if(proxy)return proxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 添加时间 [非空]       **/
		public M addTime(Object addTime){if(proxy)return proxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	 	/** and add_time is null */
 		public M addTimeNull(){if(proxy)return proxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
 		/** not .... */
 		public M addTimeNot(){if(proxy)return proxy().addTimeNot();this.put("addTimeNot", "not");return this;};
 		public M addTimeNotNull(){if(proxy)return proxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
 		public M addTimeNot(Object addTime){if(proxy)return proxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	 		
 		/** and add_time >= ? */
 		public M addTimeStart(Object start){if(proxy)return proxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
 		/** and add_time <= ? */
 		public M addTimeEnd(Object end){if(proxy)return proxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 状态 [非空]   1:正常 0:无效     **/
		public M status(Object status){if(proxy)return proxy().status(status);  this.put("status", status);return this;};
	 	/** and status is null */
 		public M statusNull(){if(proxy)return proxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
 		/** not .... */
 		public M statusNot(){if(proxy)return proxy().statusNot();this.put("statusNot", "not");return this;};
 		public M statusNotNull(){if(proxy)return proxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
 		public M statusNot(Object status){if(proxy)return proxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	 		
			
		public M statusIn(String ids){
			if(proxy)return proxy().statusIn(ids);  this.put("statusIn", ids);return this;
		};	
 			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有商品信息 **/
		public @api List<Commodity> list(Integer size){			
			return getCommodityList(this,size);
		}
		/** 获取商品信息分页 **/
		public @api Page<Commodity> page(Integer page,Integer size){			
			return getCommodityPage(page, size , this);
		}
		/** 根据查询条件取商品信息 **/
		public @api Commodity get(){			
			return getCommodity(this);
		}
		/** 获取商品信息数 **/
		public @api Long count(){			
			return getCommodityCount(this);
		}
		/** 获取商品信息表达式 **/
		public @api <T> T eval(String strEval){			
			return getCommodityEval(strEval,this);
		}
		
		/** 获取商品信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getCommodityStats(this,sumKey,groupKey,dateType);
		}
		/** 获取商品信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getCommodityStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateCommodity(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteCommodity(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String id="id";
	 			
			
	 	
			
		/** 商品名称 [非空]       **/
		public final static @type(String.class)  String name="name";
	 			
			
	 	
			
		/** 标题 [非空]       **/
		public final static @type(String.class)  String title="title";
	 			
			
	 	
			
		/** 排序     数值越大越排前   **/
		public final static @type(Integer.class)  String cSort="cSort";
	 			
		/** and c_sort >= ? */
		public final static @type(Integer.class) String cSortMin="cSortMin";
		/** and c_sort <= ? */
		public final static @type(Integer.class) String cSortMax="cSortMax";
				
			
	 	
			
		/** 所属品牌 [非空] [Merchant]      **/
		public final static @type(Long.class)  String merchant="merchant";
	 			
			
	 	
			
		/** 规格属性 [非空]   text:name     **/
		public final static @type(String.class)  String options="options";
	 			
			
	 	
			
		/** 商品单位  [Unit]      **/
		public final static @type(Long.class)  String unit="unit";
	 			
			
	 	
			
		/** 配送费 [非空]       **/
		public final static @type(Double.class)  String distriFee="distriFee";
	 			
		/** and distri_fee >= ? */
		public final static @type(Double.class) String distriFeeMin="distriFeeMin";
		/** and distri_fee <= ? */
		public final static @type(Double.class) String distriFeeMax="distriFeeMax";
				
			
	 	
			
		/** 叠加配送费 [非空]       **/
		public final static @type(Double.class)  String overFee="overFee";
	 			
		/** and over_fee >= ? */
		public final static @type(Double.class) String overFeeMin="overFeeMin";
		/** and over_fee <= ? */
		public final static @type(Double.class) String overFeeMax="overFeeMax";
				
			
	 	
			
		/** 商品描述 [非空]       **/
		public final static @type(String.class) @like String descr="descr";
	 			
			
	 	
			
		/** 轮播图 [非空]       **/
		public final static @type(String.class)  String shufs="shufs";
	 			
			
	 	
			
		/** 列表图 [非空]       **/
		public final static @type(String.class)  String image="image";
	 			
			
	 	
			
		/** 假销量 [非空]       **/
		public final static @type(Integer.class)  String saleVol="saleVol";
	 			
		/** and sale_vol >= ? */
		public final static @type(Integer.class) String saleVolMin="saleVolMin";
		/** and sale_vol <= ? */
		public final static @type(Integer.class) String saleVolMax="saleVolMax";
				
			
	 	
			
		/** 真实销量        **/
		public final static @type(Integer.class)  String raleVol="raleVol";
	 			
		/** and rale_vol >= ? */
		public final static @type(Integer.class) String raleVolMin="raleVolMin";
		/** and rale_vol <= ? */
		public final static @type(Integer.class) String raleVolMax="raleVolMax";
				
			
	 	
			
		/** 价格 [非空]       **/
		public final static @type(Double.class)  String price="price";
	 			
		/** and price >= ? */
		public final static @type(Double.class) String priceMin="priceMin";
		/** and price <= ? */
		public final static @type(Double.class) String priceMax="priceMax";
				
			
	 	
			
		/** 划线价格     显示在商品详情页的划线价格；   **/
		public final static @type(Double.class)  String cPrice="cPrice";
	 			
		/** and c_price >= ? */
		public final static @type(Double.class) String cPriceMin="cPriceMin";
		/** and c_price <= ? */
		public final static @type(Double.class) String cPriceMax="cPriceMax";
				
			
	 	
			
		/** 分区价格    tree:area menoy:price     **/
		public final static @type(String.class) @like String zonePrice="zonePrice";
	 			
			
	 	
			
		/** 充多少 [非空]       **/
		public final static @type(Integer.class)  String howMuch="howMuch";
	 			
		/** and how_much >= ? */
		public final static @type(Integer.class) String howMuchMin="howMuchMin";
		/** and how_much <= ? */
		public final static @type(Integer.class) String howMuchMax="howMuchMax";
				
			
	 	
			
		/** 赠多少 [非空]       **/
		public final static @type(Integer.class)  String howMany="howMany";
	 			
		/** and how_many >= ? */
		public final static @type(Integer.class) String howManyMin="howManyMin";
		/** and how_many <= ? */
		public final static @type(Integer.class) String howManyMax="howManyMax";
				
			
	 	
			
		/** 二维码        **/
		public final static @type(String.class)  String cQrCode="cQrCode";
	 			
			
	 	
			
		/** 修改时间 [非空]       **/
		public final static @type(Date.class)  String updateTime="updateTime";
	 			
	 	/** and update_time >= ? */
 		public final static @type(Date.class) String updateTimeStart="updateTimeStart";
 		/** and update_time <= ? */
 		public final static @type(Date.class) String updateTimeEnd="updateTimeEnd";
				
			
	 	
			
		/** 添加时间 [非空]       **/
		public final static @type(Date.class)  String addTime="addTime";
	 			
	 	/** and add_time >= ? */
 		public final static @type(Date.class) String addTimeStart="addTimeStart";
 		/** and add_time <= ? */
 		public final static @type(Date.class) String addTimeEnd="addTimeEnd";
				
			
	 	
			
		/** 状态 [非空]   1:正常 0:无效     **/
		public final static @type(Short.class)  String status="status";
	 			
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		id("id"),
		name("name"),
		title("title"),
		cSort("c_sort"),
		merchant("merchant"),
		options("options"),
		unit("unit"),
		distriFee("distri_fee"),
		overFee("over_fee"),
		descr("descr"),
		shufs("shufs"),
		image("image"),
		saleVol("sale_vol"),
		raleVol("rale_vol"),
		price("price"),
		cPrice("c_price"),
		zonePrice("zone_price"),
		howMuch("how_much"),
		howMany("how_many"),
		cQrCode("c_qr_code"),
		updateTime("update_time"),
		addTime("add_time"),
		status("status"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取商品信息数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = Commodity.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = Commodity.getCommodity(params);
			else
				value = Commodity.getCommodityList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  Commodity.where().id(param).get();
		else if(!Utils.empty(param.toString()))
			value = Commodity.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getId());
	
		Utils.fms(map,simple?"":"id",this.getId(),this.getId$());
		
			
 		
	
		Utils.fms(map,simple?"":"name",this.getName(),this.getName$());
		
			
 		
	
		Utils.fms(map,simple?"":"title",this.getTitle(),this.getTitle$());
		
			
 		
	
		Utils.fms(map,simple?"sort":"cSort",this.getcSort(),this.getcSort$());
		
			
 		
	
		Utils.fms(map,simple?"":"merchant",this.getMerchant(),this.getMerchant$());
		
			
 		
	
		Utils.fms(map,simple?"":"options",this.getOptions(),this.getOptions$());
		
			
 		
	
		Utils.fms(map,simple?"":"unit",this.getUnit(),this.getUnit$());
		
			
 		
	
		Utils.fms(map,simple?"fee":"distriFee",this.getDistriFee(),this.getDistriFee$());
		
			
 		
	
		Utils.fms(map,simple?"fee":"overFee",this.getOverFee(),this.getOverFee$());
		
			
 		
	
		Utils.fms(map,simple?"":"descr",this.getDescr(),this.getDescr$());
		
			
 		
	
		Utils.fms(map,simple?"":"shufs",this.getShufs(),this.getShufs$());
		
			
 		
	
		Utils.fms(map,simple?"":"image",this.getImage(),this.getImage$());
		
			
 		
	
		Utils.fms(map,simple?"vol":"saleVol",this.getSaleVol(),this.getSaleVol$());
		
			
 		
	
		Utils.fms(map,simple?"vol":"raleVol",this.getRaleVol(),this.getRaleVol$());
		
			
 		
	
		Utils.fms(map,simple?"":"price",this.getPrice(),this.getPrice$());
		
			
 		
	
		Utils.fms(map,simple?"price":"cPrice",this.getcPrice(),this.getcPrice$());
		
			
 		
	
		Utils.fms(map,simple?"price":"zonePrice",this.getZonePrice(),this.getZonePrice$());
		
			
 		
	
		Utils.fms(map,simple?"much":"howMuch",this.getHowMuch(),this.getHowMuch$());
		
			
 		
	
		Utils.fms(map,simple?"many":"howMany",this.getHowMany(),this.getHowMany$());
		
			
 		
	
		Utils.fms(map,simple?"qrCode":"cQrCode",this.getcQrCode(),this.getcQrCode$());
		
			
 		
	
		Utils.fms(map,simple?"time":"updateTime",this.getUpdateTime(),this.getUpdateTime$());
		
			
 		
	
		Utils.fms(map,simple?"time":"addTime",this.getAddTime(),this.getAddTime$());
		
			
 		
	
		Utils.fms(map,simple?"":"status",this.getStatus(),this.getStatus$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("id",this.getId());
 		
	
		map.put("name",this.getName());
 		
	
		map.put("title",this.getTitle());
 		
	
		map.put("cSort",this.getcSort());
 		
	
		map.put("merchant",this.getMerchant());
 		
	
		map.put("options",this.getOptions());
 		
	
		map.put("unit",this.getUnit());
 		
	
		map.put("distriFee",this.getDistriFee());
 		
	
		map.put("overFee",this.getOverFee());
 		
	
		map.put("descr",this.getDescr());
 		
	
		map.put("shufs",this.getShufs());
 		
	
		map.put("image",this.getImage());
 		
	
		map.put("saleVol",this.getSaleVol());
 		
	
		map.put("raleVol",this.getRaleVol());
 		
	
		map.put("price",this.getPrice());
 		
	
		map.put("cPrice",this.getcPrice());
 		
	
		map.put("zonePrice",this.getZonePrice());
 		
	
		map.put("howMuch",this.getHowMuch());
 		
	
		map.put("howMany",this.getHowMany());
 		
	
		map.put("cQrCode",this.getcQrCode());
 		
	
		map.put("updateTime",this.getUpdateTime());
 		
	
		map.put("addTime",this.getAddTime());
 		
	
		map.put("status",this.getStatus());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static Commodity fromMap(Map map){
		Commodity commodity = new Commodity();
	
		commodity.id = Utils.parseLong(map.get("id"));
 		
	
		commodity.name = Utils.parseString(map.get("name"));
 		
	
		commodity.title = Utils.parseString(map.get("title"));
 		
	
		commodity.cSort = Utils.parseInteger(map.get("cSort"));
 		
	
		commodity.merchant = Utils.parseLong(map.get("merchant"));
 		
	
		commodity.options = Utils.parseString(map.get("options"));
 		
	
		commodity.unit = Utils.parseLong(map.get("unit"));
 		
	
		commodity.distriFee = Utils.parseDouble(map.get("distriFee"));
 		
	
		commodity.overFee = Utils.parseDouble(map.get("overFee"));
 		
	
		commodity.descr = Utils.parseString(map.get("descr"));
 		
	
		commodity.shufs = Utils.parseString(map.get("shufs"));
 		
	
		commodity.image = Utils.parseString(map.get("image"));
 		
	
		commodity.saleVol = Utils.parseInteger(map.get("saleVol"));
 		
	
		commodity.raleVol = Utils.parseInteger(map.get("raleVol"));
 		
	
		commodity.price = Utils.parseDouble(map.get("price"));
 		
	
		commodity.cPrice = Utils.parseDouble(map.get("cPrice"));
 		
	
		commodity.zonePrice = Utils.parseString(map.get("zonePrice"));
 		
	
		commodity.howMuch = Utils.parseInteger(map.get("howMuch"));
 		
	
		commodity.howMany = Utils.parseInteger(map.get("howMany"));
 		
	
		commodity.cQrCode = Utils.parseString(map.get("cQrCode"));
 		
	
		commodity.updateTime = Utils.parseDate(map.get("updateTime"));
 		
	
		commodity.addTime = Utils.parseDate(map.get("addTime"));
 		
	
		commodity.status = Utils.parseShort(map.get("status"));
 		
	
		return commodity;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(Commodity old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/20088256422681277805.png";
	}
	public static String getIconfont(){
		return "icon-lifangtilitiduomiantifangkuai";
	}
	public static enum ACT{
		列表,添加,修改,详情
	};
	public static String getUrl(ACT act,Commodity.M params){
		if(params==null)params=new Commodity.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/goods/commodity.edit.html?";
		if(params.get("id")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("id"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/goods/commodity.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.id(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(Commodity.ACT act,Commodity.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",Commodity.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(Commodity.ACT act,Commodity.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",Commodity.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.ICommodityDao getCommodityDao(){
		return Utils.getBean("commodityDao");
	};
	
}